Subject: Comments on the CD1.7 draft (3a)             J4/00-0102

Author: Robert Jones, email: 100621.553@compuserve.com

References:

1. Committee Draft 1.7 for the proposed revision of ISO 1989:1985, COBOL standard - PDF version. I use Adobe Acrobat Reader, version 3.

2. 99-0519 Comments on the CD1.6 Draft (2) by me.

3. 99-0560 Comments on the CD1.7 Draft (1) by me.

4. 99-0598 Comments on the CD1.7 Draft (3) by me and which this supercedes

Comments:

I would like to say that I think that the transformation of the developing standard from the content and layout of the previous standard is a great improvement.

All of these items deal with the topic of separators and assumed spaces.

The main difference between this and the previous version is that it recommends that all operators and the reference modifier colon be preceded and succeeded by separator spaces rather than by space characters.

Space separators, space characters and the distinction

Discussion of the use of the character space as a separator and the use of the comma and semicolon as equivalents.

Any decisions made on this may affect decisions made on 99-0519 item 7 and 99-0560 items 15 and 16.

I still can't make up my mind about the following indented item:

As a contentious issue, consider making the separators comma and semicolon obsolete, It could be argued that they make the rules for separator spaces unnecessarily complex without adding any great benefit. Making this use for them obsolete would also enable them to be used for some more useful, though as yet unknown, purpose in the long term future.

(As a programmer, I have used them only for separating multiple subscripts, but they could reasonably be used to separate parameters or arguments. Also, they could make multiple operands of a statement that need qualifiers more readable. I think that most people would usually put separate statements on separate lines.)

However, I have written the rest of this on the basis that they won't be made obsolete, though even if they were, the items would still need consideration for this version of the standard.

I have started with 8.3.2, the other items are in the sequence of the standard. Apart from reference modification and operators, I think that the others are fairly straightforward.

1 8.3.2 Separators, page 94

Items 1 and 2, especially the third sentence of item 1. While I think that this implies that separator commas and separator semicolons followed by a separator space are logically equivalent to a separator space, an explicit statement to say so might be desirable if it is true, otherwise a statement to the contrary would be helpful. "5.1.7 Punctuation" states that they are interchangeable. I am not keen on rules by implication, it is surprising how even the seemingly obvious can be ambiguous or misleading under certain circumstances.

Perhaps it is required that a distinction be made between the term "space" and "separator space", in that the former must be the character space, though it is still a separator, but may be part of another separator, while the latter may also be a separator comma or separator semicolon. If so, then perhaps this is the right place to specify it. Perhaps the terms "separator space", "space characters" and "character space" should be used more generally within the standard where that is what is meant, including within 8.3.2. However, when doing so care must be taken not to get confused with the assumed spaces that terminate source text lines that are not continued with a continuation indicator on the following line and the assumed spaces that precede and succeed source text. Consistency of use would also make it easier to search the text of the standard.

I don't think it is desirable for separator commas and semicolons to be repeated together or separately, nor to follow separator periods. However, it is arguable that the standard should not be expected to deal with such unreasonable misuse.

Having considered the above issues, I have provided a reworked text for 8.3.2, it is largely the same with a few relatively minor alterations.

********************************************************************

text as revised for consideration

Suggested changes are underlined.

8.3.4 Separators

A separator is one of the following, except when appearing in a literal or picture character-string.

1) The space character is a separator. Anywhere a space character is used as a separator or as part of a separator, more than one space character may be used. All space characters immediately following the separators comma, semicolon or period are considered part of that separator and are not considered to be the separator space. An explanation of the situations where a space character shall be assumed to be present is given in 6, Reference format.

2) The COBOL characters comma and semicolon, immediately followed by a space character, are separators that may be used anywhere the separator space is used and with the same meaning. They may be used to improve readability.

3) The COBOL character period, when followed by a space character is a separator. It shall be used only to indicate the end of a sentence, or as shown in formats.

4) The COBOL characters right and left parentheses are separators. Except in pseudo-text, parentheses may appear only in balanced pairs of left and right parentheses delimiting subscripts, a list of function or method arguments, reference modifiers, arithmetic or boolean expressions, or conditions.

5) The opening delimiters and closing delimiters of literals are separators. Either an apostrophe or a quotation mark may be used as the quotation symbol character in opening and closing delimiters.

The opening delimiters of literals are:

- a quotation symbol

- the two contiguous characters B", B', N", N', X" and X'

- the three contiguous characters BX", BX', NX" and NX'

The closing delimiters of literals are:

- a quotation symbol when the opening delimiter uses a quotation mark

- an apostrophe when the opening delimiter uses an apostrophe

The opening delimiter shall be immediately preceded by a space character, left parenthesis, or opening pseudo-text delimiter. The closing delimiter shall be immediately followed by one of the separators space, comma, semicolon, period, right parenthesis, or closing pseudo-text delimiter. Separators immmediately preceding the opening delimiter are not part of the opening delimiter. Separators immediately following the closing delimiter are not part of the closing delimiter.

6) Pseudo-text delimiters are separators. An opening pseudo-text delimiter shall be immediately preceded by a space character; a closing pseudo-text delimiter shall be immediately followed by one of the separators space, comma, semicolon, or period. Pseudo-text delimiters may appear only in balanced pairs delimiting pseudo-text.

7) The COBOL character colon, except as part of the invocation operator, is a separator and is required when shown in the general formats.

8) The separator space may optionally precede all separators except:

a) As specified by reference format rules (see 6, Reference format.)

b) The closing delimiter of a literal. In this case, a preceding space character is considered as part of the literal and not as a separator

c) The opening pseudo-text delimiter, where the preceding space character is required.

d) the period following the end of a picture character-string, when that picture character-string is the last item of a data description entry and is terminated by a comma or period.

9) The separator space may optionally immediately follow any separator except the opening delimiter of a literal. A space character following the opening delimiter of a literal shall be part of the literal and not a separator.

2 Use of terms "separator space" and "space character" - generally

While most of the following items relate to tidying up the terminology, there are still residual cases where the unqualified terms "space" or "spaces" are the appropriate form. There are several cases where the term "non-space" is used and for which "non-blank" might be preferable. The term "non-blank" is also already used for similar purposes, as is "nonblank" without the hyphen, "nonspace" without the hyphen and "non space" with the intervening blank. The term "space-filled" is used in several places, where perhaps "blank" or "filled with space characters" might be better in some but not all cases.

3 Definitions, 4.130, Debugging indicator, page 14

Replace "followed by a space" by "followed by a space character".

4 Description techniques, 5.1.7 Punctuation, page 34

Perhaps add "See 8.3.2 Separators."

There could be a caveat to explain that certain formats and rules are further qualified for the situations where one or more space characters must be present in particular positions, e.g. after picture character-strings, or where none is needed, such as unary arithmetic operators and parentheses in some circumstances. However, it is arguable that reference to 8.3.2 would suffice.

5 Reference format, 6.1.2, Floating indicators, page 37

Alongside the description for "compiler directive" replace "intervening space" by "intervening space character".

6 Reference format, 6.1.3, Floating indicators, Syntax rules, page 37

Rule 1, replace "space" by "space character".

7 Reference format, 6.2.3, Program-text area, page 39

Last line, replace "spaces" by "space characters".

8 Reference format, 6.2.4, Continuation of lines, page 39

In the seventh text block, commencing "In the case of continuation ...", replace "spaces" by "space characters".

In the last paragraph, replace "space" by "space character".

9 Reference format, 6.3.1, Continuation of lines, page 40

Last word of first para, replace "space" by "space character".

Second para, fifth line, replace "spaces or one or more spaces" by "space characters or one or more space characters".

10 Reference format, 6.3.4, Debugging of lines, page 41

First para, first line, replace "space" by "space character".

11 Reference format, 6.4, Logical conversion, page 42

Item 3, replace "spaces" by "space characters".

Item 5, replace "space" by "space character".

12 Text manipulation elements, 7.1.1.4, Text-words, page 46

Item 1, first line, replace "space" by "space character".

13 COPY statement, 7.1.2.2, Syntax rules, page 47

Rule 2, replace "space" by "space character".

14 COPY statement, 7.1.2.3, General rules, page 48

Rule 8a, second line, replace "space" by "space character".

Rule 8c1, second line and third lines, replace "single space" by "single space character".

Rule 8c5, replace "space" by "space character".

Rule 10, replace the four instances of "space" and "spaces" by "space character" and "space characters" respectively, including the note.

15 REPLACE statement, 7.1.3.2, Syntax rules, page 51

Rule 2, replace "space" by "space character".

16 REPLACE statement, 7.1.3.3, General rules, page 52

Rule 10c1, second line and third lines, replace "single space" by "single space character".

Rule 10c5, replace "space" by "space character".

Rule 12, replace the four instances of "space" and "spaces" by "space character" and "space characters" respectively, including the note.

17 Compiler directives, 7.2.2, Syntax rules, page 54

Rule 5, while the meaning is the same, I think that "the COBOL character space" could be replaced by "a space character", this would make text searches easier and be more consistent with the rest of the standard.

Rule 5, third line, replace both instances of "space" by "space characters".

18 Character strings, 8.3.1.2.2.2, Floating-point literals, page 88

Item 1, replace "spaces" by "intervening space characters" or maybe even "intervening separator spaces".

19 Character strings, 8.3.1.2.5.3, Figurative constant values, General rules, page 93

Rule 4, while there is nothing wrong with the existing text, consider replacing "of the character space" by "space characters" for consistency with terminology elsewhere and making text searching easier.

20 Identifiers, 8.4.2.3, Reference modifier, page 105

As the colon is a separator, it is arguable that no separators are required between it and its operands or the right parenthesis, but this is not what is shown in the general format. This is the only use of the colon as a separator, though it is also used as an editing character in picture character-strings.

21 Operators, 8.7, generally, page 129

Consider whether all operators should be separated from their operands in the same way. Consider whether it should be permissible for separator commas and semicolons to be interposed as per "5.1.7 Punctuation", as long as a space character precedes and follows an operator. Maybe rules for the separation of operators from operands should be specified here rather than individually, though attention must be given to the cases where an operator has only one operand and where no space is required between an operator and a parenthesis.

E.g. "Operators shall be separated from their operands by only one or more space characters and shall in any case be preceded and followed by a space character, except that unary arithmetic operators may immediately precede a left parenthesis, or immediately succeed a right parenthesis."

Also consider in conjunction with "8.8.4.2 Complex conditions".

Even if it is decided that the separation of operands and operators should be dealt with separately by type, a general view before deciding on individual cases would be desirable, especially when deciding how to treat combinations of different types of expression.

I have also made tentative suggestions for the individual types of operator separately.

While in "99-0598, item 21", as copied above, I considered that operators should be immediately preceded and succeeded by space characters, I now think that it is preferable for them to continue to be preceded and succeeded by separator spaces for the purposes of the definition of the standard. Otherwise a whole class of exceptions to the general rules expressed in "5.1.7 Punctuation" and "8.3.2 Separators" is introduced and makes definition much messier. Arguably, it is up to the user to use separator commas and semicolons sensibly. However, I think that it is still desirable for the terminology and rules for operators to be self consistent as suggested by item 21, though now the term "separator space" would be more appropriate than "space character" as a replacement for the term "space" in items 22 to 26 of 99-0598. (Suitably revised versions are listed below.)

A somewhat different view also could be taken, in that COBOL words are delimited by separators of whatever kind and operators are COBOL words. Consequently, except where parentheses may be used, operators are necessarily delimited by separator spaces, since they can not be preceded or succeeded by separator periods, colons, quotes or apostrophes, and, therefore, no further explanation of this is required in any of the items subordinate to "8.7 Operators". (The use of pseudo-text delimiters is irrelevant here, because they are only used in the compiler directing facility.) However, explanatory notes in "8.7 Operators" and "8.8.4.2 Complex conditions" might still be desirable to point this out with a reference to "8.3.2 Separators". Such an approach would also automatically allow the existing uses of parentheses before and after unary operators without intervening separator spaces.

22 Operators, 8.7.1, Arithmetic operators, page 129

First para, second and third lines, replace all three instances of "space" by "separator space".

23 Operators, 8.7.2, Boolean operators, page 129

As there isn't a general format for boolean operators or expressions, consider whether it is desirable to specify that boolean operators be separated from their operands by separator spaces. E.g. insert as a second sentence "A boolean operator shall be preceded and followed by a separator space, except that the B-NOT operator may be immediately preceded by a left parenthesis.".

24 Operators, 8.7.3, Concatenation operator, page 129

No action.

25 Operators, 8.7.4, Invocation operator, page 129

No action

26 Operators, 8.7.5, Relational operators, page 129

First para, first line, replace "space" by "separator space".

27 Operators, 8.7.6, Logical operators, page 130

Dealt with in 8.8.4.2

28 Conditional expressions, 8.8.4.1.1.6.1, Standard comparison, page 139

Item 2, second line, consider replacing "spaces" by "space characters", while the context makes the meaning clear, text searches of the standard would be easier for the change.

29 Conditional expressions, 8.8.4.1.1.6.2, Locale-based comparison, page 139

First para and following note, for the same reason, consider replacing all four instances of "space" and "spaces" by "space character" and "space characters" respectively.

30 Conditional expressions, 8.8.4.1.1.8.1, Standard comparison, page 140

Item 2, second line, consider replacing "spaces" by "space characters", while the context makes the meaning clear, text searches of the standard would be easier for the change.

31 Conditional expressions, 8.8.4.1.1.8.2, Locale-based comparison, page 139

First para and following note, for the same reason, consider replacing all four instances of "space" and "spaces" by "space character" and "space characters" respectively.

32 Class condition, 8.8.4.1.3.3, General rules, page 143

Rule 3b, consider replacing the last word "spaces" by "space characters", the meaning is currently clear, but text searches would be easier for the change.

33 Conditional expressions, 8.8.4.2, Complex conditions, page 145

Last para, replace both instances of "space" by "separator space".

Also perhaps add ", except that the NOT operator may be immediately preceded by a left parenthesis.".

34 SOURCE-COMPUTER paragraph, 12.2.4.2, General rules, page 200

Rule 4, last word, replace "spaces" by "space characters".

35 SPECIAL-NAMES, 12.2.6.2, Syntax rules, page 208

Rule 20b, consider replacing "space" by "space character".

Rule 24b, consider replacing "space" by "space character".

36 BLANK WHEN ZERO clause, 13.16.10.3, General rules, page 281

Rule 1, consider replacing "spaces" by "space characters".

37 COLUMN clause, 13.16.16.3, General rules, page 290

Rule 9, consider replacing "blank characters" by "space characters".

38 DEFAULT clause, 13.16.18, introduction, page 294

Consider replacing "spaces" by "space characters".

39 DEFAULT clause, 13.16.18.3, General rules, page 294

Rule 1a, 1b & 1c, consider replacing the three terminating words "spaces" by "space characters".

Rule 4, consider replacing "spaces" by "space characters".

40 FULL clause, 13.16.27.2, General rules, page 306

Rule 3, first line, consider replacing "spaces" by "space characters".

41 JUSTIFIED clause, 13.16.33.3, General rules, page 312

Rule 2, should the two instances of "SPACES" be capitalised, should they be replaced by "space characters".

42 PICTURE clause, 13.16.41.2, Syntax rules, page 331

Consider adding a rule stating that "A picture character-string shall be preceded by a space character. It shall be immediately succeeded by either a space character or a separator period.". Such a statement could perhaps instead be the first part of rule 8. The rules expressed by "5.1.7 Punctuation" and "8.3.2 Separators" arguably make the first sentence unnecessary, so perhaps the statement should just be "A picture character-string shall be immediately succeeded by either a space character or a separator period.".

43 PICTURE clause, 13.16.41.3, General rules, page 334

Rule 11b, second line, replace "spaces" by "space characters" or "separator spaces".

Rule 12, for "B", consider replacing "character space" by "space character".

Rule 12, for "Z", consider replacing "character space" by "space character".

Rule 13, for "B", consider replacing "character space" by "space character" for both instances.

Rule 13, for "Z", no action, it has already been done.

Rule 16, for "Z", consider replacing "character space" by "space character".

44 PICTURE clause, 13.16.41.4, Editing rules, page 339

Rule 1, penultimate line, consider replacing "spaces" by "space characters".

Rule 8, second line, consider replacing "character space" by "space character".

Rule 8b, fourth and fifth line, consider replacing "character space" by "space character".

45 SUM Clause, 13.16.55.3, General rules, page 369

Rule 4, consider replacing "spaces" by "space characters".

46 Procedures, 14.5.2, Paragraphs, page 398

First line, consider replacing "period and a space" by "separator period". Already suggested by item 16 of 99-571.

47 MERGE statement, 14.10.23.3, General rules, page 483

Rules 2 and 13, consider replacing "space-filled" by "padded". The meaning is still clear because both the sentences go on to say that "alphanumeric space characters" are to be used for the purpose.

48 SORT statement, 14.10.36.3, General rules, page 536

Rules 6 and 15, consider replacing "space-filled" by "padded". The meaning is still clear because both the sentences go on to say that "alphanumeric space characters" are to be used for the purpose.

49 VALIDATE statement, 14.10.46.3, General rules, page 564

Rule 8, last word, consider replacing "spaces" by "space characters".

50 EXCEPTION-FILE function, 15.23.2, Returned values, page 597

Fifth line, consider replacing "spaces" by "space characters".

Sixth line, consider replacing "spaces" by "alphanumeric space characters".

51 EXCEPTION-LOCATION function, 15.24.2, Returned values, page 598

Rule 1, consider replacing "space" by "space character".

Rule 2, first para, line 4, consider replacing "space" by "space character".

Rule 2b, consider replacing the three instances of "space" by "space character".

52 EXCEPTION-STATEMENT function, 15.25.2, Returned values, page 599

Rule 1, consider replacing "spaces" by "space characters" or even "alphanumeric space characters".

53 EXCEPTION-STATUS function, 15.26.2, Returned values, page 600

Rule 1, consider replacing both instances of "spaces" by "space characters".

54 LOCALE-COMPARE, 15.38.3, Returned values, page 612

Rule 2, consider replacing both instances of "spaces" by "space characters" and "space" by "space characters".

55 NATIONAL-OF, 15.51.3, Returned values, page 625

Rule 3, consider replacing "space" by "space character".

56 NUMVAL, 15.52, introduction, page 626

Consider replacing "spaces" by "space characters".

57 NUMVAL-C, 15.53, Arguments, page 627

Rule 2, consider replacing "spaces" by "space characters".

Rule 6a, top line of page 628, consider replacing "space" by "space character" and "spaces" by "space characters".

Rule 7b7, consider replacing "spaces" by "space characters".

58 NUMVAL-F, 15.54, introduction, page 628

Consider replacing "spaces" by "space characters".

59 NUMVAL-F, 15.54.2, Arguments, page 629

Rule 1, text block following subsidiary format, consider replacing "spaces" by "space characters".

60 NUMVAL-F, 15.54.3, Returned values, page 629

Rule 1, consider replacing "spaces" by "space characters".

61 STANDARD-COMPARE function, 15.67.3, Returned values, page 642

Rule 3, consider replacing both instances of "spaces" by "space characters" and "space" by "space characters".

62 TEST-NUMVAL, 15.73.3, Returned values, page 648

Rule 1b, note 1, consider replacing "spaces" by "space characters".

63 TEST-NUMVAL-C, 15.74.2, Arguments, page 649

Rule 2, consider replacing "spaces" by "space characters".

64 TEST-NUMVAL-C, 15.74.3, Returned values, page 649

Rule 1b, note 1, consider replacing "spaces" by "space characters".

65 TEST-NUMVAL-F, 15.75.2, Returned values, page 650

Rule 1d, note 1, consider replacing "spaces" by "space characters".

66 COMMUNICATIONS facility, A.1.2.3, General rules, page 662

Rule 3, consider replacing "shall contain spaces" by "shall be all space characters". The start of the sentence "The contents of ..." already provides the meaning provided by "contain".

Rule 5, second para, third line, consider replacing "spaces" by "space characters".

Rule 6, first para, last line, consider replacing "spaces" by "all space characters".

Rule 6, second para, consider replacing "spaces" by "all space characters".

Rule 10, last word, consider replacing "spaces" by "all space characters".

Rule 28, second and third paragraphs, consider replacing "spaces" by "all space characters".

67 Report writer, C.18.3.3, Column, page 797

Seventh line, consider replacing "spaces" by "space characters".

68 Report writer, C.18.4.1, PRESENT WHEN, page 798

Second para, consider replacing "spaces" by "space characters".

Eighth para, consider replacing "spaces" by "space characters".

69 Validate facility, C.19.1, Format validation, page 802

First para, third line, consider replacing "spaces" by "space characters".

70 D.2, Substantive changes not affecting existing programs, page 833

Item 5, Arithmetic operators, consider replacing "space" by "separator space".